package environment;

import java.util.Vector;

public class DPBM {
//	private static int counterID;
	private Id id;
	private int age;//value between 0 to 1.
	private int NumberOfMates;//value between 0-7
	
	//Constructor
	public DPBM(Id motherId){
		this.id = motherId.extendId();
		this.age = 0;
		this.NumberOfMates = 0;
	}
	
	public void increaseNumberOfMates(){
		this.NumberOfMates++;
	}
	
	public void increaseAge(){
		this.age++;
	}
	
	public int getAge() {
		return age;
	}
	
	public int getNumberOfMates() {
		return NumberOfMates;
	}
	
	//TODO: fix vector size to constant size of 3
	public double getRelation(DPBF female) {
		int ans = 1;
		Id femaleID = female.getId();
		// Check if the female is his mother
		if (femaleID.getIdAt(0) == this.id.getIdAt(1)) {
			ans = 0;// TODO: set real value here
		}
		// Check if the female is his grand mother
		else if (femaleID.getIdAt(0) == this.id.getIdAt(2)) {
			ans = 0;// TODO: set real value here
		}
		// check if the female is his sister
		else if (femaleID.getIdAt(1) == this.id.getIdAt(1)) {
			ans = 0;// TODO: set real value here
		}
		// check if the female is his aunt
		else if (femaleID.getIdAt(1) == this.id.getIdAt(2)) {
			ans = 0;// TODO: set real value here
		}

		// check if the female is his niece
		else if (femaleID.getIdAt(2) == this.id.getIdAt(1)) {
			ans = 0;// TODO: set real value here
		}
		// check if the female is his cousin
		else if (femaleID.getIdAt(2) == this.id.getIdAt(2)) {
			ans = 0;// TODO: set real value here
		}

		return ans;
	}// end of get relation
	
	
}
